package edu.zut.hb.software.chat.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import edu.zut.hb.software.base.service.impl.GenericManagerImpl;
import edu.zut.hb.software.chat.dao.ChatDao;
import edu.zut.hb.software.chat.domain.Chat;
import edu.zut.hb.software.chat.service.ChatService;


@Service
@Transactional
public class ChatServiceImpl extends GenericManagerImpl<Chat,Long> implements ChatService {

	ChatDao chatDao;

    @Autowired
    public void setDepartmentDao(ChatDao chatDao) {
        this.chatDao = chatDao;
        this.dao=this.chatDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
        	Chat c = new Chat();
            c.setName("第"+i+"聊天室");
            c.setNum(i);
            c.setStatus(true);
            list.add(c);
        }
        return list;
    }
}
